<?
namespace xto\data\service;

use think\Db;
use xto\App;
use xto\data\Sql;


class ModuleService{
	static function getmodules(){
		$map['status']=1;
		return Sql::select('xto_module',$map); 
	}

	static function getmodule($addons){
		$map['addons']=$addons;
		return Sql::select('xto_module',$map); 
	}

	static function getaddons(){ 
		$mods=[];
		foreach (ModuleService::getmodules() as $key => $value) {
			$mods=[$value['addons']];
		}
		$map['module']    =   ['IN', $mods];
		return Sql::select('xto_addons',$map); 
	}
}